home *** CD-ROM | disk | FTP | other *** search
/ Directorty Opus 5 - Magellan 2 / Opus 5 - Magellan 2.iso / Extras / D51_NUSource / Include / Nudel_Constants.i next >
Text File  |  1996-01-06  |  10KB  |  329 lines

  1. *****************************************************************************
  2. * Various                                                                   *
  3. *****************************************************************************
  4. EqCCR    Equ    %0000000000000100
  5. NeCCR    Equ    %0000000000000000
  6.  
  7. ;CustomBase    = $dff000    Base Address of Custom Chips
  8.  
  9. ;;; With hindsight, these Bxx_ErrorX_xxx macros could have been implemented as
  10. ;;; one or two more generic macros which took the type of branch as one of
  11. ;;; their arguments. Still, I'd already typed out most of the different cases
  12. ;;; when this fact dawned upon me, and the output is the same, so I've left it,
  13. ;;; for now at least.
  14.  
  15. Bra_ErrorE_Int    MACRO            Arg1 = Adr Action. (eg. "MyAction(pc)")
  16. ;                    Arg2 = Ptr to Active NIB (eg. "MyNIB_Adr(a5)")
  17. ;                           or Null.
  18.     Lea    \1,a0            -._ Setup current action from
  19.     Move.l    a0,CAction(a5)        -'  the first argument.
  20.     Move.l    \2,Active_NIB(a5)    Setup current NIB (filename).
  21.     OPT O-
  22.     Bra    ErrorE_Internal        Fatal Error, ignore DOS error code.
  23.     OPT O+
  24.     ENDM
  25.  
  26.  
  27. Bgt_ErrorE_Int    MACRO            Arg1 = Adr Action. (eg. "MyAction(pc)")
  28. ;                    Arg2 = Ptr to Active NIB (eg. "MyNIB_Adr(a5)")
  29. ;                           or Null.
  30.     Ble.s    BEGTI_S\@        Skip if no error.
  31.     Lea    \1,a0            -._ Setup current action from
  32.     Move.l    a0,CAction(a5)        -'  the first argument.
  33.     Move.l    \2,Active_NIB(a5)    Setup current NIB (filename).
  34.     OPT O-
  35.     Bra    ErrorE_Internal        Fatal Error, ignore DOS error code.
  36.     OPT O+
  37. BEGTI_S\@
  38.     ENDM
  39.  
  40.  
  41. Blt_ErrorE_Int    MACRO            Arg1 = Adr Action. (eg. "MyAction(pc)")
  42. ;                    Arg2 = Ptr to Active NIB (eg. "MyNIB_Adr(a5)")
  43. ;                           or Null.
  44.     Bge.s    BELTI_S\@        Skip if no error.
  45.     Lea    \1,a0            -._ Setup current action from
  46.     Move.l    a0,CAction(a5)        -'  the first argument.
  47.     Move.l    \2,Active_NIB(a5)    Setup current NIB (filename).
  48.     OPT O-
  49.     Bra    ErrorE_Internal        Fatal Error, ignore DOS error code.
  50.     OPT O+
  51. BELTI_S\@
  52.     ENDM
  53.  
  54.  
  55. Beq_ErrorE_Int    MACRO            Arg1 = Adr Action. (eg. "MyAction(pc)")
  56. ;                    Arg2 = Ptr to Active NIB (eg. "MyNIB_Adr(a5)")
  57. ;                           or Null.
  58.     Bne.s    BEEEI_S\@        Skip if no error.
  59.     Lea    \1,a0            -._ Setup current action from
  60.     Move.l    a0,CAction(a5)        -'  the first argument.
  61.     Move.l    \2,Active_NIB(a5)    Setup current NIB (filename).
  62.     OPT O-
  63.     Bra    ErrorE_Internal        Fatal Error, ignore DOS error code.
  64.     OPT O+
  65. BEEEI_S\@
  66.     ENDM
  67.  
  68.  
  69. Bne_ErrorE_Int    MACRO            Arg1 = Adr Action. (eg. "MyAction(pc)")
  70. ;                    Arg2 = Ptr to Active NIB (eg. "MyNIB_Adr(a5)")
  71. ;                           or Null.
  72.     Beq.s    BNEEI_S\@        Skip if no error.
  73.     Lea    \1,a0            -._ Setup current action from
  74.     Move.l    a0,CAction(a5)        -'  the first argument.
  75.     Move.l    \2,Active_NIB(a5)    Setup current NIB (filename), or NULL.
  76.     OPT O-
  77.     Bra    ErrorE_Internal        Fatal Error, ignore DOS error code.
  78.     OPT O+
  79. BNEEI_S\@
  80.     ENDM
  81.  
  82.  
  83. Bra_ErrorE    MACRO            Arg1 = Adr Action. (eg. "MyAction(pc)")
  84. ;                    Arg2 = Ptr to Active NIB (eg. "MyNIB_Adr(a5)")
  85. ;                           or Null.
  86.     Lea    \1,a0            -._ Setup current action from
  87.     Move.l    a0,CAction(a5)        -'  the first argument.
  88.     Move.l    \2,Active_NIB(a5)    Setup current NIB (filename).
  89.     OPT O-
  90.     Bra    ErrorE            Fatal Error.
  91.     OPT O+
  92.     ENDM
  93.  
  94. Beq_ErrorE    MACRO            Arg1 = Adr Action. (eg. "MyAction(pc)")
  95. ;                    Arg2 = Ptr to Active NIB (eg. "MyNIB_Adr(a5)")
  96. ;                           or Null.
  97.     Bne.s    BEEE_S\@        Skip if no error.
  98.     Lea    \1,a0            -._ Setup current action from
  99.     Move.l    a0,CAction(a5)        -'  the first argument.
  100.     Move.l    \2,Active_NIB(a5)    Setup current NIB (filename).
  101.     OPT O-
  102.     Bra    ErrorE            Fatal Error.
  103.     OPT O+
  104. BEEE_S\@
  105.     ENDM
  106.  
  107. Bne_ErrorE    MACRO            Arg1 = Adr Action. (eg. "MyAction(pc)")
  108. ;                    Arg2 = Ptr to Active NIB (eg. "MyNIB_Adr(a5)")
  109. ;                           or Null.
  110.     Beq.s    BNEE_S\@        Skip if no error.
  111.     Lea    \1,a0            -._ Setup current action from
  112.     Move.l    a0,CAction(a5)        -'  the first argument.
  113.     Move.l    \2,Active_NIB(a5)    Setup current NIB (filename).
  114.     OPT O-
  115.     Bra    ErrorE            Fatal Error.
  116.     OPT O+
  117. BNEE_S\@
  118.     ENDM
  119.  
  120. Bsr_ErrorW    MACRO            Arg1 = Adr Action. (eg. "MyAction(pc)")
  121. ;                    Arg2 = Ptr to Active NIB (eg. "MyNIB_Adr(a5)")
  122. ;                           or Null.
  123.     Lea    \1,a0            -._ Setup current action from
  124.     Move.l    a0,CAction(a5)        -'  the first argument.
  125.     Move.l    \2,Active_NIB(a5)    Setup current NIB (filename).
  126.     OPT O-
  127.     Bsr    ErrorW            Warning.
  128.     OPT O+
  129.     ENDM
  130.  
  131. Bsreq_ErrorW    MACRO            Arg1 = Adr Action. (eg. "MyAction(pc)")
  132. ;                    Arg2 = Ptr to Active NIB (eg. "MyNIB_Adr(a5)")
  133. ;                           or Null.
  134.     Bne.s    BSEW_S\@        Skip if no error.
  135.     Lea    \1,a0            -._ Setup current action from
  136.     Move.l    a0,CAction(a5)        -'  the first argument.
  137.     Move.l    \2,Active_NIB(a5)    Setup current NIB (filename).
  138.     OPT O-
  139.     Bsr    ErrorW            Warning.
  140.     OPT O+
  141. BSEW_S\@
  142.     ENDM
  143.  
  144. Bsrne_ErrorW    MACRO            Arg1 = Adr Action. (eg. "MyAction(pc)")
  145. ;                    Arg2 = Ptr to Active NIB (eg. "MyNIB_Adr(a5)")
  146. ;                           or Null.
  147.     Beq.s    BSNW_S\@        Skip if no error.
  148.     Lea    \1,a0            -._ Setup current action from
  149.     Move.l    a0,CAction(a5)        -'  the first argument.
  150.     Move.l    \2,Active_NIB(a5)    Setup current NIB (filename).
  151.     OPT O-
  152.     Bsr    ErrorW            Warning.
  153.     OPT O+
  154. BSNW_S\@
  155.     ENDM
  156.  
  157. Bsr_ErrorN    MACRO            Arg1 = Adr Action. (eg. "MyAction(pc)")
  158. ;                    Arg2 = Ptr to Active NIB (eg. "MyNIB_Adr(a5)")
  159. ;                           or Null.
  160.     Lea    \1,a0            -._ Setup current action from
  161.     Move.l    a0,CAction(a5)        -'  the first argument.
  162.     Move.l    \2,Active_NIB(a5)    Setup current NIB (filename).
  163.     OPT O-
  164.     Bsr    ErrorN            Note.
  165.     OPT O+
  166.     ENDM
  167.  
  168. Bsreq_ErrorN    MACRO            Arg1 = Adr Action. (eg. "MyAction(pc)")
  169. ;                    Arg2 = Ptr to Active NIB (eg. "MyNIB_Adr(a5)")
  170. ;                           or Null.
  171.     Bne.s    BSEN_S\@        Skip if no error.
  172.     Lea    \1,a0            -._ Setup current action from
  173.     Move.l    a0,CAction(a5)        -'  the first argument.
  174.     Move.l    \2,Active_NIB(a5)    Setup current NIB (filename).
  175.     OPT O-
  176.     Bsr    ErrorN            Note.
  177.     OPT O+
  178. BSEN_S\@
  179.     ENDM
  180.  
  181. Bsrne_ErrorN    MACRO            Arg1 = Adr Action. (eg. "MyAction(pc)")
  182. ;                    Arg2 = Ptr to Active NIB (eg. "MyNIB_Adr(a5)")
  183. ;                           or Null.
  184.     Beq.s    BSNN_S\@        Skip if no error.
  185.     Lea    \1,a0            -._ Setup current action from
  186.     Move.l    a0,CAction(a5)        -'  the first argument.
  187.     Move.l    \2,Active_NIB(a5)    Setup current NIB (filename).
  188.     OPT O-
  189.     Bsr    ErrorN            Note.
  190.     OPT O+
  191. BSNN_S\@
  192.     ENDM
  193.  
  194. ;    This macro is like EVEN, but it makes things ODDly aligned!
  195. ;    It should be called with one argument: the lable of a known EVEN
  196. ;    address (which is before the macro is used!).
  197. ODD    MACRO
  198. ERP\@    Equ    *-\1
  199.     IFEQ    (((ERP\@)*10)/2)-(((ERP\@)/2)*10)
  200.     Dc.b    0
  201.     ENDC
  202.     ENDM
  203.  
  204. ;    This macro is like EVEN, but it inserts a space instead of a null.
  205. ;    It should be called with one argument: the lable of a known EVEN
  206. ;    address (which is before the macro is used!).
  207. SPACEEVEN    MACRO
  208. SEERP\@    Equ    *-\1
  209.     IFNE    (((SEERP\@)*10)/2)-(((SEERP\@)/2)*10)
  210.     Dc.b    " "
  211.     ENDC
  212.     ENDM
  213.  
  214. ;    This macro is like EVEN, but for RS-Tables. It ensures an Even
  215. ;    RS counter by reserving an extra byte if it's odd.
  216. ;    Note that when reserving a long or a word in an RS-Table, DevPac
  217. ;    automatically aligns it. This is only useful for .b reserves
  218. ;    (Eg text...)
  219. RSEven    MACRO
  220.     IFNE    (((__RS)*10)/2)-(((__RS)/2)*10)
  221.     Rs.b    1
  222.     ENDC
  223.     ENDM
  224.  
  225. CopyEm    MACRO            Copy d7 chars a0 -> a1
  226.     Bra.s    COPE2\@
  227. COPEM\@    Move.b    (a0)+,(a1)+
  228. COPE2\@    DBra    d7,COPEM\@
  229.     ENDM
  230.  
  231. CopyCN4    MACRO            Copy nullterminated including null.
  232. CCN4\@    Move.b    (a0)+,(a1)+
  233.     Bne.s    CCN4\@
  234.     ENDM
  235.  
  236. SetReqDefault MACRO
  237.     IFD    Default_Req
  238.     BSet    #SF1_ErrorReq,STD_F_1(a5)
  239.     ELSE
  240.     BClr    #SF1_ErrorReq,STD_F_1(a5)
  241.     ENDC
  242.     ENDM
  243.  
  244.  
  245. ;=====================================================================================;
  246. ; NUDEL-INFO-BLOCK STRUCTURE                                  ;
  247. ;=====================================================================================;
  248.         RSReset
  249. NIB_Next    Rs.l    1        Pointer to next NIB - Null if this is the last.
  250. NIB_Previous    Rs.l    1        Pointer to previous NIB, Null if the first.
  251. NIB_MemSize    Rs.l    1        Size of allocation - Null if none.
  252. NIB_MemAdrs    Rs.l    1        Address of allocation - Null if none.
  253. NIB_NameAdrs    Rs.l    1        Address of null-term (file)name - Null if none.
  254. NIB_Handle    Rs.l    1        Handle if file is open - Null if not.
  255. NIB_Lock    Rs.l    1        Lock if file is locked - Null if not.
  256. NIB_FIB        Rs.l    1        Pointer to FileInfoBlock - Null if none.
  257. NIB_SizeOf    Equ    __RS
  258. ;=====================================================================================;
  259.  
  260. ***************************************************************************************
  261. * Rexx Sys Lib library                                      *
  262. ***************************************************************************************
  263. N_CallRexSysLib MACRO
  264.     Move.l    N_RexBase(a5),a6
  265.     Jsr    _LVO\1(a6)
  266.     ENDM
  267. N_JumpRexSysLib    MACRO
  268.     Move.l    N_RexBase(a5),a6
  269.     Jmp    _LVO\1(a6)
  270.     ENDM
  271.  
  272. REXXSYSLIBNAME    MACRO
  273.     Dc.b    "rexxsyslib.library",0
  274.     ENDM
  275. ***************************************************************************************
  276. N_CallDOS    MACRO
  277.     Move.l    N_DOSBase(a5),a6
  278.     Jsr    _LVO\1(a6)
  279.     ENDM
  280. N_JumpDOS    MACRO
  281.     Move.l    N_DOSBase(a5),a6
  282.     Jmp    _LVO\1(a6)
  283.     ENDM
  284. *****************************************************************************
  285. N_CallInt    MACRO
  286.     Move.l    N_IntBase(a5),a6
  287.     Jsr    _LVO\1(a6)
  288.     ENDM
  289. N_JumpInt    MACRO
  290.     Move.l    N_IntBase(a5),a6
  291.     Jmp    _LVO\1(a6)
  292.     ENDM
  293. *****************************************************************************
  294. N_CallIFFParse    MACRO
  295.     Move.l    N_IFFBase(a5),a6
  296.     Jsr    _LVO\1(a6)
  297.     ENDM
  298. IFFPARSENAME    MACRO
  299.     Dc.b    "iffparse.library",0
  300.     ENDM
  301. *****************************************************************************
  302. N_Callmathieeedoubbas    MACRO
  303.     Move.l    N_mathieeedoubbasBase(a5),a6
  304.     Jsr    _LVO\1(a6)
  305.     ENDM
  306. mathieeedoubbasNAME    MACRO
  307.     Dc.b    "mathieeedoubbas.library",0
  308.     ENDM
  309. *****************************************************************************
  310. N_CallGfx    MACRO
  311.     Move.l    N_GfxBase(a5),a6
  312.     Jsr    _LVO\1(a6)
  313.     ENDM
  314. GFXNAME    MACRO
  315.     Dc.b    "graphics.library",0
  316.     ENDM
  317. *****************************************************************************
  318. AbsExecBase    =  $4
  319. ;---------------------------------------------------------------------------;
  320. N_CallExec    MACRO
  321.     Move.l    (AbsExecBase).w,a6
  322.     Jsr    _LVO\1(a6)
  323.     ENDM
  324. N_JumpExec    MACRO
  325.     Move.l    (AbsExecBase).w,a6
  326.     Jmp    _LVO\1(a6)
  327.     ENDM
  328. *****************************************************************************
  329.